Adventures
in Moderation

Jeffrey M. Girard
University of Kansas

Introduction

Overview

  • What is moderation in ANOVA and regression models?

  • What questions can (and can’t) moderation answer?

  • What tools can we use to test and probe interactions?

  • ANOVA Examples: 2x2, 3x2

  • Regression Examples: (2x2), 2xC, CxC

  • What are some challenges and opportunities?

Defining Moderation

  • Moderation adds contextualization/complexity to a model

  • It allows an IV’s effect to depend on the values of other IVs

  • It is usually tested using (bilinear) product terms

  • There won’t be just one effect of the IV for everyone…

  • …it depends on who each person is, in terms of other IVs

  • (It is like a gateway drug for mixed effects modeling)

Example Research Questions

Categorical-by-Categorical - Does the effect of exercise program on weight loss depend on biological sex?

Categorical-by-Continuous - Does the effect of hours of exercise on weight loss depend on exercise program?

Continuous-by-Continuous - Does the effect of hours of exercise on weight loss depend on the effort put in?

Moderation is not mediation and cannot establish causation

Moderation hypotheses should be specific and falsifiable

Free and Open-Source Tools

R is a cross-platform statistical computing environment

RStudio adds a helpful environment for working with R

The {easystats} package adds statistics functions

Example:
2x2 ANOVA

Hypotheses and Data

  1. Training will increase scores (relative to a control condition)

  2. Training will increase scores for women more than for men

subject score condition gender
1 5.876475 training woman
2 4.805460 control woman
3 3.384664 training woman
4 4.086933 control woman
5 4.749709 control man
6 5.905577 training woman
7 6.005326 training man
8 3.208133 control woman
9 4.838511 training woman
10 5.127727 training woman
11 5.158661 control woman
12 4.321588 control woman
13 5.582489 training man
14 6.743740 training woman
15 5.280495 control man
16 5.543959 control woman
17 4.709095 training man
18 4.827145 control man
19 6.451114 training woman
20 6.320117 training man
21 2.589054 control man
22 4.720086 control woman
23 5.071068 control man
24 7.096972 training man
25 4.274268 control woman
26 6.460575 training man
27 6.456440 training man
28 6.265848 control woman
29 4.763044 control woman
30 3.979886 training woman
31 5.339553 control woman
32 6.895974 training woman
33 4.313938 training man
34 5.095529 training man
35 4.712894 control woman
36 5.342586 control man
37 4.445261 training woman
38 4.342722 control woman
39 3.985711 control man
40 5.953967 training woman
41 3.846046 control man
42 5.853868 training man
43 5.648286 training man
44 5.876512 training woman
45 6.506987 control woman
46 4.572705 training woman
47 4.412859 control woman
48 7.958926 training woman
49 6.173742 training woman
50 5.834424 training man
51 6.609042 control woman
52 4.384601 training woman
53 5.010130 control woman
54 3.947642 control woman
55 5.933923 training woman
56 5.058090 control man
57 2.959927 control man
58 4.873361 control man
59 3.594148 control man
60 4.714534 training man
61 3.264649 control man
62 4.588575 training woman
63 5.089966 control woman
64 4.163905 control man
65 7.127579 training woman
66 6.005201 training man
67 4.437437 control man
68 5.365165 control woman
69 4.105399 training man
70 5.635135 control woman
71 5.022247 training woman
72 4.180026 control woman
73 6.752384 training man
74 4.181650 training woman
75 6.044261 training man
76 4.213103 control man
77 6.115964 training woman
78 5.527988 control woman
79 5.734455 training man
80 5.387702 training man
81 4.183703 training woman
82 5.163233 training woman
83 5.478410 control woman
84 3.306088 control man
85 6.261406 control woman
86 5.536015 training woman
87 6.881067 control woman
88 4.633545 training woman
89 4.505152 training woman
90 3.482766 control woman
91 5.459823 training man
92 3.713462 training man
93 6.456246 training man
94 4.719504 control woman
95 5.088813 training woman
96 3.936570 control man
97 3.045063 training man
98 5.812886 training man
99 3.608662 control man
100 4.625465 control man
101 3.716192 training woman
102 4.130171 training man
103 4.793977 control man
104 5.767222 training man
105 5.087236 control woman
106 6.551865 control woman
107 6.295529 training man
108 5.841340 training man
109 4.390190 training man
110 3.357638 control man
111 4.211005 control man
112 6.286031 control woman
113 3.568811 control woman
114 5.112539 training man
115 4.997397 training woman
116 4.467550 control man
117 4.906547 control man
118 3.718384 control woman
119 3.944646 control woman
120 3.917821 control man
121 5.728532 control woman
122 5.281620 training man
123 5.708913 control man
124 5.249298 training woman
125 4.454345 control woman
126 6.730907 training woman
127 4.962171 training woman
128 6.095822 training woman
129 5.951963 training man
130 3.735796 control man
131 2.772235 control woman
132 5.499271 training man
133 6.358859 control woman
134 4.172441 training man
135 5.749763 training woman
136 3.839864 control woman
137 6.754586 training woman
138 5.222653 training man
139 5.272819 training woman
140 3.945108 control man
141 4.287297 control man
142 4.365866 control man
143 5.101909 training woman
144 4.065691 control man
145 5.559181 control woman
146 4.757044 control woman
147 3.809915 training man
148 3.104902 control man
149 6.030397 control woman
150 3.626316 control man
151 5.397467 control woman
152 3.667918 control man
153 6.056584 training man
154 4.473312 control woman
155 3.989827 control woman
156 4.696250 control woman
157 3.407245 control man
158 6.073001 training man
159 5.562025 control woman
160 4.917394 training woman
161 6.520379 training woman
162 4.077757 control man
163 5.460912 training man
164 5.231007 control woman
165 5.748438 control man
166 6.326105 control woman
167 5.451902 training man
168 4.902787 training man
169 6.107737 training man
170 5.220152 control man
171 5.292647 training man
172 3.713711 control woman
173 5.905406 training man
174 6.075597 training woman
175 3.740196 control man
176 4.454490 training woman
177 4.733459 control man
178 4.269386 control woman
179 5.404058 training woman
180 7.179318 training man
181 4.113804 control man
182 6.464315 training woman
183 4.278438 control woman
184 4.631153 control man
185 6.812150 control woman
186 4.390155 control woman
187 4.555936 training woman
188 6.047384 training man
189 5.327824 control woman
190 5.106458 training woman
191 4.484803 training woman
192 4.873373 training man
193 6.282335 training man
194 7.693778 control woman
195 7.364219 training man
196 5.578385 control man
197 4.827206 control woman
198 3.023665 control woman
199 4.158985 control man
200 4.455009 training man

Fitting the Model in ANOVA

  • We can use the aov() function to fit simple ANOVAs like this

  • The formula will be DV ~ IV1 * IV2 for a two-way ANOVA

  • We will then use model_parameters() to get Type 3 results

  • Finally, we will estimate_means() and estimate_contrasts()

library(easystats)
model1 <- aov(
  formula = score ~ condition * gender,
  data = data_2x2
)

ANOVA Model Parameters

mp1 <- model_parameters(
  model = model1, 
  contrasts = c("contr.sum", "contr.poly"), 
  type = 3
)
print(mp1)
Model Summary
Parameter Sum_Squares df Mean_Square F p
(Intercept) 1443.22 1 1443.22 1612.45 < .001
condition 4.16 1 4.16 4.65 0.032
gender 13.77 1 13.77 15.38 < .001
condition:gender 9.14 1 9.14 10.22 0.002
Residuals 175.43 196 0.90

Estimating Marginal Means

em1 <- estimate_means(
  model = model1, 
  at = c("condition", "gender")
)
print(em1)
Estimated Marginal Means
condition gender Mean SE 95% CI
control woman 4.99 0.12 (4.74, 5.23)
training woman 5.39 0.14 (5.12, 5.66)
control man 4.25 0.14 (3.97, 4.53)
training man 5.51 0.13 (5.25, 5.77)

Marginal means estimated at condition, gender

Plotting Marginal Means

plot(em1)

Estimating and Testing Contrasts

ec1a <- estimate_contrasts(
  model = model1,
  contrast = "condition",
  at = "gender"
)
print(ec1a)
Marginal Contrasts Analysis
Level1 Level2 gender Difference 95% CI SE t(196) p
control training man -1.26 (-1.64, -0.88) 0.19 -6.48 < .001
control training woman -0.40 (-0.77, -0.03) 0.19 -2.16 0.032

Marginal contrasts estimated at condition, p-value adjustment method: Holm (1979)

Estimating and Testing Contrasts

ec1b <- estimate_contrasts(
  model = model1,
  contrast = "gender",
  at = "condition"
)
print(ec1b)
Marginal Contrasts Analysis
Level1 Level2 condition Difference 95% CI SE t(196) p
woman man control 0.74 ( 0.37, 1.11) 0.19 3.92 < .001
woman man training -0.12 (-0.50, 0.26) 0.19 -0.64 0.526

Marginal contrasts estimated at gender, p-value adjustment method: Holm (1979)

Example:
3x2 ANOVA

Hypotheses and Data

  1. Treatment will decrease symptoms (vs. control and placebo)

  2. Treatment will be more effective for women than for men

patient symptoms group gender
1 3.683067 treatment man
2 3.831002 placebo man
3 3.751012 treatment man
4 3.350506 treatment man
5 3.999081 placebo man
6 4.040540 treatment man
7 3.789107 placebo woman
8 1.631338 treatment woman
9 5.865339 control man
10 3.959936 placebo woman
11 4.208445 treatment man
12 5.238969 control man
13 3.956852 placebo woman
14 4.101691 treatment man
15 4.584589 placebo woman
16 4.654177 control woman
17 5.096955 control woman
18 3.757290 treatment man
19 5.972139 control woman
20 3.650344 placebo man
21 3.960412 placebo man
22 2.371775 treatment woman
23 4.471384 control woman
24 4.223687 treatment man
25 3.720213 placebo man
26 2.636796 treatment woman
27 2.561717 treatment woman
28 3.483105 placebo woman
29 4.853836 control man
30 2.742955 treatment woman
31 2.998217 treatment woman
32 3.874644 placebo woman
33 2.410750 treatment woman
34 4.280384 control woman
35 3.993854 placebo woman
36 4.176368 placebo man
37 5.342086 control man
38 3.502481 treatment man
39 2.609248 treatment woman
40 4.101993 placebo woman
41 3.875935 treatment man
42 5.168324 control man
43 3.295567 treatment man
44 3.545530 treatment man
45 5.174403 control man
46 3.158648 placebo woman
47 2.672171 treatment man
48 5.058088 control man
49 3.227256 placebo man
50 5.128927 control woman
51 3.824916 control woman
52 3.916943 treatment man
53 3.208675 treatment man
54 3.885213 placebo man
55 4.717599 control man
56 2.829732 treatment man
57 2.984161 placebo woman
58 3.834124 placebo woman
59 3.786460 treatment man
60 1.984711 treatment woman
61 3.521415 treatment man
62 5.283700 control man
63 3.957941 placebo woman
64 2.003426 treatment woman
65 3.302742 placebo man
66 4.519169 control woman
67 3.315367 treatment man
68 3.321480 placebo man
69 3.092005 placebo woman
70 4.486210 control woman
71 3.889311 control woman
72 3.239938 placebo woman
73 2.494876 placebo woman
74 4.865170 control man
75 3.099088 placebo man
76 2.703681 treatment woman
77 3.294807 treatment man
78 3.167455 placebo woman
79 4.626240 control man
80 3.111319 treatment woman
81 5.244846 control woman
82 2.789232 treatment woman
83 4.391974 placebo man
84 2.671924 treatment woman
85 4.258345 control man
86 3.574922 treatment man
87 4.862326 control man
88 3.094355 treatment woman
89 3.424623 treatment man
90 3.275555 treatment woman
91 2.438367 treatment woman
92 3.503636 placebo man
93 4.049056 placebo man
94 4.420680 control woman
95 3.436439 treatment man
96 3.354488 placebo woman
97 3.983255 control man
98 5.182548 control man
99 2.613542 placebo woman
100 4.055499 control woman
101 2.437038 treatment woman
102 4.679464 control man
103 4.759928 placebo man
104 3.029085 treatment woman
105 5.313118 control woman
106 5.176724 control woman
107 4.085248 control man
108 5.140998 control man
109 1.968991 treatment woman
110 5.186876 control man
111 2.284765 treatment woman
112 3.658862 placebo man
113 4.350146 treatment man
114 4.300288 treatment man
115 4.686918 control man
116 3.766755 control man
117 2.883879 placebo woman
118 3.178663 treatment man
119 2.487341 treatment woman
120 3.659114 placebo man
121 4.557424 control woman
122 4.907548 control man
123 4.655817 control woman
124 3.494930 placebo woman
125 2.574772 placebo man
126 5.417146 control man
127 3.325603 placebo woman
128 2.860576 treatment woman
129 3.338200 placebo man
130 3.473366 placebo woman
131 1.553649 treatment woman
132 3.361876 treatment woman
133 5.294677 control man
134 3.866261 placebo woman
135 3.340717 treatment woman
136 5.568056 control woman
137 4.694963 control man
138 4.268536 control man
139 2.279876 treatment woman
140 4.679343 placebo man
141 3.470273 placebo man
142 4.831236 control woman
143 3.635198 placebo woman
144 3.779816 placebo man
145 4.048951 treatment man
146 3.685560 treatment man
147 5.342175 control man
148 4.800316 control man
149 4.426206 control woman
150 3.059124 placebo man
151 4.892211 control man
152 2.261958 treatment woman
153 1.477009 treatment woman
154 5.552239 control woman
155 4.072153 treatment man
156 3.828199 placebo woman
157 2.466217 treatment woman
158 2.902365 treatment woman
159 4.066778 treatment man
160 3.591798 treatment man
161 4.479610 control woman
162 3.746472 placebo man
163 3.409870 treatment man
164 3.564776 placebo man
165 2.127127 treatment woman
166 4.304739 placebo woman
167 2.373575 treatment woman
168 2.880832 placebo woman
169 5.201406 control man
170 3.455701 placebo woman
171 2.911728 placebo woman
172 3.925479 treatment woman
173 3.338932 placebo woman
174 3.667183 placebo woman
175 1.314828 treatment woman
176 2.455877 treatment woman
177 2.362176 treatment woman
178 5.052475 control man
179 5.529821 control woman
180 3.213364 placebo man
181 4.841677 control man
182 3.651969 placebo woman
183 2.557120 treatment woman
184 4.788895 control woman
185 4.023404 placebo woman
186 4.282011 control woman
187 2.442558 placebo woman
188 3.762763 placebo woman
189 3.966392 treatment man
190 1.683476 treatment woman
191 5.951345 control man
192 2.663725 treatment woman
193 3.530330 treatment man
194 4.012764 treatment man
195 2.412654 placebo man
196 1.329439 treatment woman
197 4.522039 control woman
198 2.634963 treatment woman
199 5.169679 control woman
200 3.799478 treatment man

Fitting the Model in ANOVA

model2 <- aov(
  formula = symptoms ~ group * gender,
  data = data_3x2
)

ANOVA Model Parameters

mp2 <- model_parameters(
  model = model2, 
  contrasts = c("contr.sum", "contr.poly"), 
  type = 3
)
print(mp2)
Model Summary
Parameter Sum_Squares df Mean_Square F p
(Intercept) 615.35 1 615.35 2364.66 < .001
group 86.82 2 43.41 166.81 < .001
gender 0.36 1 0.36 1.39 0.240
group:gender 13.09 2 6.54 25.15 < .001
Residuals 50.48 194 0.26

Estimating Marginal Means

em2 <- estimate_means(model2, at = c("group", "gender"))
print(em2)
Estimated Marginal Means
group gender Mean SE 95% CI
control woman 4.77 0.10 (4.58, 4.97)
placebo woman 3.50 0.09 (3.33, 3.67)
treatment woman 2.48 0.08 (2.33, 2.64)
control man 4.93 0.09 (4.75, 5.11)
placebo man 3.63 0.10 (3.44, 3.82)
treatment man 3.68 0.09 (3.51, 3.84)

Marginal means estimated at group, gender

Plotting Marginal Means

plot(em2)

Estimating and Testing Contrasts

ec2a <- estimate_contrasts(model2, contrast = "group", at = "gender")
print(ec2a)
Marginal Contrasts Analysis
Level1 Level2 gender Difference 95% CI SE t(194) p
control placebo man 1.30 ( 0.98, 1.62) 0.13 9.81 < .001
control placebo woman 1.27 ( 0.96, 1.59) 0.13 9.73 < .001
control treatment man 1.25 ( 0.96, 1.55) 0.12 10.20 < .001
control treatment woman 2.29 ( 1.99, 2.60) 0.13 18.23 < .001
placebo treatment man -0.04 (-0.36, 0.27) 0.13 -0.35 0.936
placebo treatment woman 1.02 ( 0.74, 1.30) 0.12 8.76 < .001

Marginal contrasts estimated at group, p-value adjustment method: Holm (1979)

Estimating and Testing Contrasts

ec2b <- estimate_contrasts(model2, contrast = "gender", at = "group")
print(ec2b)
Marginal Contrasts Analysis
Level1 Level2 group Difference 95% CI SE t(194) p
woman man control -0.16 (-0.42, 0.11) 0.13 -1.18 0.240
woman man placebo -0.13 (-0.39, 0.13) 0.13 -0.98 0.327
woman man treatment -1.20 (-1.42, -0.97) 0.12 -10.32 < .001

Marginal contrasts estimated at gender, p-value adjustment method: Holm (1979)

Rational for Regression

Opportunities

  • Recreate the results from ANOVA

  • Incorporate continuous predictors/IVs

  • Incorporate any kind/number of “covariates”

  • Incorporate nonlinearity (e.g., polynomials)

  • Extend to GLM for non-normal outcomes/DVs

  • Extend to MLM for clustered/nested data

  • Extend to SEM for latent variables

Example:
2x2 Regression

Fitting the Model in Regression

ANOVA code (for reference)

model1 <- aov(
  formula = score ~ condition * gender,
  data = data_2x2
)

Regression code

model1b <- lm(
  formula = score ~ condition * gender,
  data = data_2x2
)

Comparing Moderation Models

Parameter Sum_Squares df Mean_Square F p
(Intercept) 1443.22 1 1443.22 1612.45 < .001
condition 4.16 1 4.16 4.65 0.032
gender 13.77 1 13.77 15.38 < .001
condition:gender 9.14 1 9.14 10.22 0.002
Residuals 175.43 196 0.90
Parameter Coefficient SE 95% CI t(196) p
(Intercept) 4.99 0.12 (4.74, 5.23) 40.16 < .001
condition (training) 0.40 0.19 (0.03, 0.77) 2.16 0.032
gender (man) -0.74 0.19 (-1.11, -0.37) -3.92 < .001
condition (training) × gender (man) 0.86 0.27 (0.33, 1.39) 3.20 0.002

Extensions

By giving the lm() model to the same functions, we can…

Estimate and plot (the same) marginal means

em1b <- estimate_means(model1b, at = c("condition", "gender"))
print(em1b)
plot(em1b)

Estimate and test (the same) contrasts

estimate_contrasts(model1b, contrast = "condition", at = "gender")
estimate_contrasts(model1b, contrast = "gender", at = "condition")

Example:
2xC Regression

Hypotheses and Data

  1. Exercising for a longer duration will burn more calories

  2. Long swims will be more effective than long runs

participant calories duration exercise
1 486.9765 2.0247982 swim
2 472.8959 1.3821725 run
3 381.9000 1.3681240 swim
4 384.2023 1.4285675 run
5 459.0924 2.3272059 run
6 539.3930 1.6615903 swim
7 401.4003 1.4630448 swim
8 397.0844 1.5121709 run
9 246.7168 1.4368627 swim
10 272.5706 1.0153436 swim
11 364.9235 1.7090055 run
12 298.7456 1.1187464 run
13 517.4730 1.7360870 swim
14 238.2022 1.3128362 swim
15 273.5526 1.0331437 run
16 696.8010 2.4898915 run
17 396.4383 1.2521552 swim
18 711.3158 2.8504048 run
19 421.4667 1.2994872 swim
20 520.9031 1.7577685 swim
21 399.1551 1.3919107 run
22 490.5664 2.0523853 run
23 461.3814 1.8787314 run
24 418.8214 1.2921095 swim
25 386.2042 1.4752701 run
26 553.7873 2.1345285 swim
27 459.1941 1.7606419 swim
28 359.6371 1.8502758 run
29 591.2767 2.5190743 run
30 648.0497 2.5144626 swim
31 311.0183 1.0141624 run
32 590.6766 1.3583350 swim
33 554.7981 2.0242906 swim
34 753.9970 2.6053155 swim
35 410.9739 1.7576647 run
36 405.6490 1.6033452 run
37 504.7794 2.0862072 swim
38 703.8329 2.5526066 run
39 520.8601 2.3704378 run
40 496.4263 1.8792767 swim
41 592.9068 2.3074787 run
42 688.9164 2.6912732 swim
43 459.9332 1.7083987 swim
44 604.1794 1.9010350 swim
45 442.8850 1.6983853 run
46 407.9747 1.4556758 swim
47 480.6806 2.0919576 run
48 745.8023 2.6535681 swim
49 489.1903 1.9158584 swim
50 658.7930 2.1719204 swim
51 525.0054 2.1882373 run
52 553.2563 1.9027302 swim
53 225.7835 0.9423320 run
54 373.1410 1.5434663 run
55 649.7859 2.1748546 swim
56 465.0962 2.2027886 run
57 524.8834 2.2526631 run
58 298.0463 1.1040664 run
59 503.7600 1.6692555 run
60 535.0446 1.8138636 swim
61 453.8953 2.0793305 run
62 448.7485 1.6607938 swim
63 522.9352 2.0412445 run
64 611.5877 2.6218701 run
65 693.7688 2.4402478 swim
66 494.5699 2.2719794 swim
67 436.5890 1.6045474 run
68 506.5195 2.2135723 run
69 657.3150 2.4755572 swim
70 566.0532 2.4100585 run
71 292.0450 1.0945270 swim
72 474.1026 1.8600432 run
73 617.6613 2.3355341 swim
74 816.7769 2.7984863 swim
75 462.7039 1.6371341 swim
76 551.6663 2.4802876 run
77 713.1180 2.4782198 swim
78 609.7088 2.6329238 run
79 476.8087 1.8815219 swim
80 370.2146 1.2399430 swim
81 668.3936 2.1697767 swim
82 686.7034 2.6979870 swim
83 429.6422 1.4069689 run
84 442.3489 1.7977642 run
85 425.3900 1.8564469 run
86 672.3602 2.4712929 swim
87 372.3098 1.4726307 run
88 456.4376 1.6713612 swim
89 563.7933 1.7928556 swim
90 496.6736 2.2269833 run
91 509.8858 1.7230230 swim
92 601.9327 2.1769343 swim
93 485.9239 2.0741429 swim
94 510.3737 2.1882560 run
95 750.1839 2.7534936 swim
96 367.3109 1.5363525 run
97 497.9109 1.7064294 swim
98 840.7540 3.2294629 swim
99 616.4693 2.3368709 run
100 466.5235 2.1672122 run
101 813.8330 2.8045210 swim
102 341.9197 1.4423004 swim
103 538.2966 2.0050650 run
104 533.4335 1.4738210 swim
105 566.0748 2.2169616 run
106 590.7031 2.3290448 run
107 338.1217 1.2799633 swim
108 610.8300 2.2366806 swim
109 438.1448 1.5970739 swim
110 387.2061 1.6072670 run
111 310.1953 1.4323247 run
112 376.5662 1.5442874 run
113 479.5830 2.0449831 run
114 480.1373 1.8819526 swim
115 724.9867 2.8137896 swim
116 604.7393 2.2526003 run
117 542.7069 2.0187187 run
118 504.2774 2.1825826 run
119 348.8282 1.3026996 run
120 519.7228 2.3175673 run
121 462.2700 1.7611237 run
122 408.7308 1.5900129 swim
123 582.0695 2.6261921 run
124 411.2592 1.3408250 swim
125 567.4711 2.2721306 run
126 495.5337 1.9065515 swim
127 685.5443 2.3079818 swim
128 581.1644 2.2639938 swim
129 512.6728 2.1172276 swim
130 533.8828 1.9438510 run
131 334.7888 1.3418515 run
132 539.4534 1.8316162 swim
133 505.0998 2.2392051 run
134 388.8688 1.4530442 swim
135 649.0873 2.6307028 swim
136 513.1374 2.0180076 run
137 834.2074 2.9405336 swim
138 437.2265 1.5667725 swim
139 503.4449 1.5025761 swim
140 345.7169 1.2413832 run
141 539.9918 1.9799114 run
142 352.5483 1.1067311 run
143 724.8370 2.4781231 swim
144 521.8461 1.8597521 run
145 412.4266 1.7944063 run
146 433.7123 1.7682848 run
147 255.0309 0.7725315 swim
148 503.2697 2.1564432 run
149 369.8479 1.6043309 run
150 575.9216 2.1127325 run
151 330.4060 1.1080961 run
152 345.6405 1.3150856 run
153 592.7174 2.1969883 swim
154 489.6851 2.1336110 run
155 451.7196 2.0436179 run
156 622.8804 2.7759325 run
157 529.4093 2.3977643 run
158 578.7621 2.1706701 swim
159 377.5654 1.4450951 run
160 403.5881 1.4788189 swim
161 566.3034 1.9055026 swim
162 571.0665 2.6430154 run
163 426.0878 1.2844053 swim
164 400.3703 1.8062697 run
165 473.1179 1.7486985 run
166 568.8180 2.0337752 run
167 610.9184 2.2532732 swim
168 391.3575 1.3591922 swim
169 456.8028 1.4723230 swim
170 472.4160 1.7589106 run
171 677.9135 2.3642659 swim
172 456.1863 1.8908098 run
173 720.5866 2.6544566 swim
174 483.1441 1.8746492 swim
175 499.1261 1.7271725 run
176 669.3015 2.6154537 swim
177 425.2697 1.7310856 run
178 587.5653 2.2979109 run
179 527.2292 2.2259815 swim
180 502.5024 1.6678979 swim
181 266.1488 0.8861173 run
182 584.7520 1.9996355 swim
183 570.9862 2.6794293 run
184 363.5350 1.3362204 run
185 528.4117 2.1248815 run
186 270.5534 1.4199320 run
187 607.8367 2.6272930 swim
188 502.5881 1.8613267 swim
189 490.5813 1.8864095 run
190 436.3197 1.7725541 swim
191 575.4885 1.9436487 swim
192 534.6002 1.9829328 swim
193 499.4114 1.8009545 swim
194 469.5905 1.8328453 run
195 621.7169 2.2795903 swim
196 487.5178 1.8785222 run
197 310.7343 1.1549574 run
198 340.1598 1.3524512 run
199 604.2201 2.5151987 run
200 485.3175 1.6131578 swim
201 517.7148 2.1987332 run
202 345.6452 1.6339589 run
203 432.5128 2.2782919 run
204 471.3572 1.7366560 run
205 469.3288 1.4949134 swim
206 500.2970 1.8481248 run
207 473.2479 1.5036224 swim
208 574.3772 2.2865004 run
209 549.5592 2.2810127 run
210 457.4513 1.7086970 run
211 619.9736 2.5101894 run
212 402.9696 1.8388787 run
213 523.0114 1.9804562 swim
214 534.0091 2.1155032 run
215 806.5378 2.6742191 swim
216 611.5919 2.6630524 run
217 634.6245 1.9759511 swim
218 454.8344 1.7013932 swim
219 481.7028 2.3038684 run
220 629.6170 2.4100758 swim
221 558.3575 1.8963233 swim
222 327.4352 1.3568557 run
223 577.7574 2.2027033 swim
224 652.6858 2.2877986 swim
225 399.3339 1.6700979 run
226 498.4742 1.4772452 swim
227 573.9528 2.1667294 swim
228 391.2898 1.6346929 run
229 447.3620 1.9520290 run
230 641.0104 2.8396592 run
231 508.5105 1.8569021 run
232 539.4666 2.4821575 run
233 430.4994 1.6392192 swim
234 595.6283 2.1155764 swim
235 580.6120 2.9060750 run
236 478.5022 1.6950776 swim
237 381.8860 1.5279678 run
238 569.9180 2.2736918 run
239 567.5700 2.1639122 swim
240 344.5753 1.8032291 run
241 395.8164 1.4924014 swim
242 425.6812 1.6866865 swim
243 784.5746 2.3911675 swim
244 620.0504 3.3468893 run
245 692.6378 2.9321096 run
246 617.8225 2.5891923 run
247 518.3671 1.9136030 run
248 250.5662 1.0118327 run
249 469.9183 1.8794926 run
250 382.4043 1.4775046 swim
251 532.7137 2.4126705 run
252 216.6400 0.9246425 run
253 468.9990 2.1378735 run
254 530.0574 2.5336028 run
255 602.5167 2.8599362 run
256 581.5413 2.1499824 swim
257 617.4461 2.5497054 swim
258 646.6101 2.2573090 swim
259 626.1248 2.2447256 swim
260 455.8306 1.4956228 swim
261 665.0507 2.2969297 swim
262 404.4268 1.8882466 run
263 352.5399 1.3676008 run
264 552.6479 1.9058879 swim
265 566.5589 2.1059959 run
266 404.2725 1.5409786 swim
267 420.8090 1.5301990 swim
268 412.8585 1.8357175 run
269 750.7532 2.6710935 swim
270 521.4205 1.9897437 run
271 550.4266 1.8602216 run
272 453.5186 1.6679728 run
273 860.0864 3.0289471 swim
274 469.8367 1.4904957 run
275 657.8459 2.5975101 swim
276 452.2333 2.1491049 swim
277 480.4230 2.0775148 run
278 557.5080 2.1295221 run
279 632.9417 2.2720281 swim
280 468.6496 1.4711412 swim
281 484.7340 2.4699356 run
282 443.4077 1.8582948 run
283 482.2144 1.5864967 run
284 741.5248 2.9812446 swim
285 348.4961 1.5521005 run
286 747.9164 3.2244027 run
287 395.2979 1.7333078 run
288 532.4208 2.0444902 run
289 413.3065 1.2879297 run
290 483.3166 1.8916819 run
291 445.5594 1.8529907 swim
292 507.4554 1.7979370 swim
293 409.4575 1.7568796 swim
294 301.9665 1.2992459 run
295 523.3978 2.1804282 run
296 715.6622 2.9466068 swim
297 448.0202 1.9812995 swim
298 589.6015 1.5747256 swim
299 544.2143 2.2365115 swim
300 536.1614 2.0824728 swim

Fitting the Model in Regression

model3 <- lm(
  formula = calories ~ duration * exercise,
  data = data_2xC
)

Regression Model Parameters

mp3 <- model_parameters(model = model3)
print(mp3)
Parameter Coefficient SE 95% CI t(296) p
(Intercept) 101.44 16.54 (68.89, 133.99) 6.13 < .001
duration 191.42 8.28 (175.12, 207.72) 23.11 < .001
exercise (swim) -38.85 24.49 (-87.05, 9.35) -1.59 0.114
duration × exercise (swim) 52.51 12.15 (28.60, 76.42) 4.32 < .001

Plotting the Relations

plot(estimate_relation(model3))

Estimating Simple Slopes

The slope of duration is different for running vs. swimming

We can use estimate_slopes() to get these “simple slopes”

es3 <- estimate_slopes(model3, trend = "duration", at = "exercise")
print(es3)
Estimated Marginal Effects
exercise Coefficient SE 95% CI t(296) p
run 191.42 8.28 (175.12, 207.72) 23.11 < .001
swim 243.93 8.89 (226.44, 261.42) 27.45 < .001

Marginal effects estimated for duration

Plotting Simple Slopes

plot(es3)

Estimating Contrasts

ec3 <- estimate_contrasts(
  model = model3, 
  contrast = "exercise", 
  at = "duration = c(1, 2, 3)"
)
print(es3b)
Marginal Contrasts Analysis
Level1 Level2 duration Difference 95% CI SE t(296) p
run swim 1.00 -13.66 ( -39.28, 11.96) 13.02 -1.05 0.295
run swim 2.00 -66.16 ( -77.68, -54.65) 5.85 -11.31 < .001
run swim 3.00 -118.67 (-146.10, -91.24) 13.94 -8.51 < .001

Marginal contrasts estimated at exercise, p-value adjustment method: Holm (1979)

Example:
CxC Regression

Hypotheses and Data

  1. Attachment anxiety and avoidance will both predict reduced marital satisfaction

  2. The lowest satisfaction will be from those high on both anxiety and avoidance

participant satisfaction aa_anxiety aa_avoidance
1 0.4318792 0.9001420 -1.2979397
2 0.7464191 -1.1733458 -1.6821959
3 0.3861420 -0.8974854 0.0513762
4 0.2232373 -1.4445014 -0.2682647
5 -0.7684968 -0.3310136 -0.0227639
6 1.0004048 -2.9006290 0.3812566
7 -0.3436840 -1.0592557 0.3629539
8 -0.4922589 0.2779547 0.4375966
9 -0.1300136 0.7494859 -0.7302396
10 -0.3741905 0.2415825 -0.8557735
11 0.1709354 1.0061857 0.2164843
12 -1.1790747 -0.1851460 1.1400816
13 1.6410552 -0.9818267 -1.6680926
14 -0.9697921 0.0929079 -0.3050043
15 0.8311237 -0.0527844 -0.4654157
16 1.4663046 -0.0803279 0.0517803
17 0.3227590 -0.6541037 0.2455527
18 0.5613374 -0.9506835 -1.5182153
19 0.2867013 1.0195618 -0.5799413
20 0.2252759 0.8590464 -0.1091493
21 0.4219218 0.3644608 0.8277526
22 -0.4174537 0.3836510 -0.0410328
23 -0.8307720 1.1134057 1.6417072
24 -1.4653868 1.2115098 0.2353753
25 1.6109624 -0.3483255 -0.6145876
26 -0.1949855 -0.8595534 0.8395645
27 -0.4571056 0.6500272 -0.2379615
28 0.3654884 0.3280591 0.6915284
29 -1.2968775 -0.5179466 0.2454411
30 0.8860042 -0.2389821 -0.6837880
31 0.5425709 0.1177789 -1.9980682
32 0.1560483 0.8315185 0.3260024
33 -0.4192886 -1.5589189 0.6991556
34 0.5947842 -0.2205191 -1.2905544
35 0.6887242 -0.8171944 -0.0523127
36 -2.3396787 1.0766774 -0.6557311
37 -2.9128123 1.0796640 1.5789708
38 -0.3232953 0.1421281 -0.1849386
39 0.4294992 0.1569795 -0.1330408
40 -1.0115718 -0.1687203 -0.4641793
41 0.9539652 -0.2690377 -0.1847743
42 -0.7423944 0.8077684 0.2863153
43 0.6097210 -1.1247172 -0.7653544
44 1.1044353 -1.4307880 -0.8196022
45 -0.0529032 0.0603567 0.5585867
46 0.9429142 -0.7929825 -0.4991149
47 0.0985013 0.3402759 -1.4183955
48 0.0725268 -0.2594687 -1.2749390
49 0.7930816 -1.3048486 0.4893368
50 0.4904928 0.3681734 -0.5604107
51 -1.5627198 1.6931900 1.0131452
52 -1.8050931 0.9958370 -0.2896957
53 -2.5484336 0.1867521 0.6029505
54 0.0655834 1.2383374 -0.0099835
55 0.8203403 0.3093733 -0.8009166
56 0.5053028 0.6357179 -0.0267354
57 1.0059764 0.0231833 -0.8906945
58 -0.4588432 1.1778636 0.9848438
59 0.1994137 -0.4535466 0.3710756
60 0.4312962 0.4159275 -0.3659960
61 1.1502339 -1.3384424 0.4676402
62 -0.3208243 -1.2919747 -0.7570802
63 -0.2599497 -0.3090742 -0.1314944
64 0.2481826 0.1565121 0.2906056
65 2.2388475 -0.8339168 0.9577650
66 -0.5760315 -0.0245493 1.2365699
67 2.4549184 -1.1373516 -0.4462885
68 -1.0100661 1.0720542 -0.1367433
69 -3.3026389 2.3144986 1.4375254
70 -0.8252522 0.4229731 0.9341494
71 0.7765073 -0.1369390 -0.2234494
72 -1.0488954 1.3283965 -0.6792860
73 -0.7864643 0.4365357 0.5555319
74 0.5199958 0.0664285 0.5760184
75 -1.0993047 1.3046598 -0.1085759
76 1.7649755 -0.2092595 -1.0254949
77 -1.0799968 1.0182530 0.7042143
78 -1.1299071 1.3660350 -0.1513658
79 -1.6126031 1.4766958 0.4766445
80 -1.5209325 0.8873065 1.9006730
81 1.5738863 -1.0159089 -0.6215937
82 -2.6556382 1.8708691 1.6032157
83 -1.1665211 1.0761984 -0.2502308
84 0.9498327 -1.0744076 -0.1646951
85 -0.7852938 -2.1955760 0.8828853
86 -0.1718298 0.5345446 -0.3473039
87 -0.7909224 1.3437334 -0.3570569
88 -0.6439796 1.3850035 1.0377893
89 -2.5453460 2.7469268 1.3386057
90 -1.9914999 -0.0459447 -0.3620045
91 -0.8787975 0.7430853 -0.6450919
92 -1.0239805 0.2604247 -0.4642506
93 2.3690470 0.4282819 0.9011336
94 -3.2273217 -0.3682588 2.3744850
95 -2.7747857 2.8874233 2.8117409
96 0.2915870 -0.6070726 0.8843984
97 1.9462405 -1.8791987 -0.8361123
98 -0.6213365 0.7183566 -1.5432852
99 -0.0092614 0.2514256 -0.1108923
100 -0.9133249 0.4670230 -0.7747928
101 -0.8827214 -0.2178884 0.7018330
102 -0.1254565 -1.2176477 -2.4209004
103 -0.5933691 -0.7540785 -0.0049251
104 -1.7725510 0.1912302 1.0769280
105 -2.5214475 1.0472828 1.9973757
106 -0.8901792 1.0898284 0.6997152
107 -2.0053899 0.6954744 1.2932863
108 0.9362436 -0.5243688 0.3010202
109 0.0788841 0.2640159 0.5694408
110 0.0090500 1.2412004 -0.4548316
111 0.3197110 0.6432972 0.8063503
112 -0.6545846 -0.9967626 -0.5565229
113 0.9702854 -2.0022985 -1.8917533
114 0.8073802 -0.4758391 -0.3311469
115 1.0146450 0.0441800 0.2314547
116 0.1046358 -1.3811354 -1.3411793
117 -0.3001633 0.2475197 -0.7585245
118 -0.9326808 0.2241897 -0.2019526
119 -0.1125392 0.8614789 1.5792732
120 1.2038981 -0.9267623 -0.3428551
121 2.0238313 -0.3204430 -0.3581328
122 0.3891326 0.6730248 -0.3462100
123 1.8491610 -1.2656298 1.4542733
124 2.1707985 -0.5185210 -1.1154073
125 -1.7876233 1.1224941 1.5397199
126 -2.5309899 -0.3159775 0.1779485
127 0.4381641 -1.7582992 -0.4881459
128 -0.0901157 1.2372534 0.7164108
129 1.2519594 -1.6639524 -0.0933916
130 0.0103133 1.8557345 -0.2727467
131 -3.0334229 1.0579974 1.2798458
132 -0.3140016 0.0372688 -0.2293450
133 1.7196178 0.0046050 -0.7442523
134 0.1709165 -1.9438343 1.1150912
135 -0.0547972 -1.5696234 -1.3903439
136 -0.1978789 -0.2732972 2.1830224
137 -0.9573274 0.4688538 -0.3008839
138 -0.0407302 1.0325388 0.4833596
139 2.3119509 -1.4183961 -1.8231016
140 0.4058282 -0.0878775 -0.2138833
141 -2.3535010 1.5786307 0.3311409
142 0.0420361 0.2446249 -0.2642851
143 -2.4964336 1.4970935 0.1231685
144 -1.0481056 0.9159064 -0.9384831
145 -0.3707612 0.3208412 0.4715169
146 -2.0273697 0.5627243 1.9784298
147 -2.2883301 0.5392953 0.1839594
148 3.5094214 -1.0734049 -1.1648886
149 -0.2352608 -1.8831606 -0.2402030
150 -1.3108549 0.9113902 0.5088021
151 -0.2716284 0.0495964 -1.2340717
152 -0.2418530 -1.2356549 1.5313468
153 1.5319982 -1.2637519 -0.8697801
154 -0.1597984 -1.1428650 -0.2467974
155 0.8184913 0.6544118 -1.5212871
156 2.8404056 -0.6768194 1.0122899
157 1.2801483 -1.0739105 -0.8426715
158 0.1640472 -0.9756581 -0.2559447
159 3.1656810 -1.1262746 -3.6122599
160 2.0247636 -1.9693127 -1.6523434
161 1.2743616 -0.5819890 -1.4335409
162 2.0635839 -1.7625071 -0.9106692
163 0.5573015 -0.5278260 0.3449202
164 1.3201986 -1.3743276 -3.3338290
165 2.0520504 -1.9337126 -1.1233537
166 0.1501339 0.9797831 2.3947355
167 1.8227365 -1.4956895 -0.1931979
168 -0.4935315 1.7008095 1.5961480
169 1.9287011 -1.4010257 0.1034533
170 0.4563414 -0.4844630 0.3321659
171 1.0677781 -1.2161786 0.1383304
172 1.4151285 0.1047705 -0.1255630
173 -0.0838008 -0.2425371 -0.1514705
174 0.3351227 -1.4157810 0.0804488
175 1.4390622 -1.0494598 -0.3479998
176 1.3849537 0.2690570 -0.3837815
177 0.7254943 -0.4787162 -0.8195401
178 1.6926268 -0.2994484 -1.9494934
179 -0.9799874 1.0381485 0.3561739
180 -1.0989264 1.0289251 0.0246007
181 0.9539940 -1.9716752 -0.3740614
182 0.8957322 -1.2833299 3.0269591
183 -0.8391831 0.0485813 0.0224010
184 -2.3056544 1.2106311 1.6652628
185 0.9679084 -0.4846706 -0.7256451
186 1.2662664 -0.7933096 -0.3673744
187 1.0457403 0.1724144 -1.1205701
188 -1.5277792 1.1052131 2.3391888
189 -0.1754647 0.7408755 -0.5065606
190 1.2058601 -0.2414466 -0.5477483
191 0.6814702 0.6149574 1.0126469
192 -0.8497423 1.3825465 0.1591452
193 0.1038677 -0.5832026 -0.6222342
194 0.7446903 -0.1979301 1.3691859
195 -0.3840437 -0.6032295 0.0401704
196 1.7543011 -1.0886484 -0.6951447
197 -0.1870959 0.1839153 -0.4255816
198 -0.8864783 1.3071363 1.3440563
199 -0.0106591 -0.1682833 -0.8101959
200 -0.2408353 0.3438407 1.4273740
201 -0.0468628 0.3764746 0.1094338
202 -0.8420080 -0.1945396 0.4211585
203 0.0252447 -2.1153360 -1.7382737
204 0.5904463 -0.9130674 -0.7915262
205 -0.5462648 0.3497093 1.2504308
206 0.0214590 0.4055771 -1.0419466
207 -0.6293104 0.5053261 -0.0835213
208 -0.8643903 -1.7918671 -0.8801539
209 0.2072623 -0.6614889 1.2525696
210 1.1155970 -0.3722728 0.3966079
211 0.3081642 0.1586610 -0.8837296
212 1.3870540 -0.6784124 -0.6618193
213 -1.4994738 0.0824890 0.5062311
214 -0.7283932 1.2437401 0.4276507
215 0.6187606 0.8804955 1.1312596
216 1.7605258 0.5439587 -1.9624287
217 -0.3031339 -0.7909051 0.2014529
218 -0.5059877 0.4271447 -0.3075433
219 -1.8975496 0.9511143 0.3327584
220 -0.6631145 0.8201171 0.2122263
221 0.4173146 -1.8109460 -1.5703982
222 0.9377251 -0.2799136 0.1391862
223 -0.8251228 0.6710683 0.0913491
224 -2.0828422 1.5969725 2.1476909
225 0.0000442 -0.7257318 -0.3204829
226 0.2557414 0.9605752 -0.2618041
227 -1.7306036 0.9564396 1.3557451
228 -1.3088122 1.2658477 0.3601722
229 -0.6199446 -0.2369562 -0.9185620
230 0.7559797 -1.5201141 -0.6354062
231 -1.3562039 0.3395534 1.6125185
232 1.1788169 1.3959739 0.0946064
233 -0.2228757 -1.1860622 0.6577650
234 0.9236243 -0.4044715 -0.2639062
235 0.7669923 -0.2871061 -0.7513423
236 -0.9580882 0.9425857 0.6260820
237 2.3860484 -1.0547386 -0.5972318
238 1.8061842 -0.6572775 -0.5567167
239 -0.4133801 -0.4142889 1.0022967
240 0.1485323 0.4539667 -0.5293854
241 1.3428984 -0.5539540 0.2504764
242 -1.2450330 0.3538685 0.3578461
243 -0.5440004 0.1482858 -1.4269887
244 0.6432294 0.3765119 -0.1613056
245 -1.7157603 1.5069871 1.0738804
246 1.7153394 -0.9272950 -0.8783255
247 -0.3540130 -0.5871412 0.0872690
248 -1.9559826 2.4589257 1.0763947
249 -2.1745707 0.6737419 1.3615485
250 1.6165741 0.3344244 -0.9102370
251 -1.9961950 1.6090419 2.0720183
252 -0.1272891 -1.1153993 -1.8701366
253 -0.9983739 0.0101301 0.8975034
254 0.5857948 -1.0523579 1.5620424
255 -0.8429583 0.4339232 0.7841885
256 1.5133899 0.6580896 0.9080449
257 1.8208861 -1.4400733 -1.3697890
258 -0.6707887 0.4733612 0.3124379
259 0.0876472 -0.8058521 -0.6340125
260 2.1685144 -0.7854659 -0.7201728
261 0.9082819 -1.1353506 -1.6270345
262 0.7440821 -0.9114252 -0.7305909
263 -1.7443183 0.0899663 -0.3068435
264 -0.7041372 -0.2360947 -0.8584979
265 -2.0138454 1.6275791 0.3957977
266 -2.3871472 0.5052006 1.3939842
267 0.0864558 0.0374373 0.9386799
268 0.3739279 0.3651652 -0.2572919
269 -0.3584666 -1.3946008 -0.5286457
270 1.2229180 0.6351347 -0.3711065
271 0.9035632 -0.4777527 0.2130855
272 0.3550738 -0.8199743 -1.1533472
273 -0.6342262 1.2523842 -0.1312231
274 0.8573957 -1.3183499 -0.2306841
275 -0.9164994 0.5442612 0.6467203
276 -0.5874836 -0.1868970 -0.6601317
277 -1.2864169 0.6159636 1.4440184
278 -1.3327523 0.5279876 -0.3323753
279 -0.3327827 0.2344553 -1.0835801
280 -0.6173638 -0.1122981 0.9970415
281 -0.0352932 -1.3162969 -0.9042622
282 0.6669514 -0.3367675 0.4157708
283 -0.4088405 0.4784102 -0.4096794
284 0.2503699 -1.0939116 -1.0393495
285 -0.2128611 1.2614056 -0.3647840
286 0.1483441 0.0360152 0.3937545
287 -3.0662083 1.8810672 1.9708598
288 -1.0263377 -0.8664550 -0.5444923
289 1.4309696 -0.9948478 0.9061844
290 1.8569767 -1.5172336 -0.4047097
291 -0.4428215 -0.0401771 1.0033186
292 1.9003993 -1.7865378 0.1202371
293 -2.3929112 0.9562462 1.5728841
294 1.4789944 -0.2804958 1.0232953
295 0.0572745 -0.4111873 -0.8075252
296 -0.2058447 -0.4634304 -0.3364237
297 0.9112563 -2.4549370 -1.1233474
298 -1.1818031 0.3128863 -0.1985622
299 0.4375730 -0.7913382 -1.0326057
300 0.2357914 0.2254650 1.2748681

Fitting the Model in Regression

model4 <- lm(
  formula = satisfaction ~ aa_anxiety * aa_avoidance,
  data = data_CxC
)

Regression Model Parameters

mp4 <- model_parameters(model = model4)
print(mp4)
Parameter Coefficient SE 95% CI t(296) p
(Intercept) -9.64e-03 0.06 (-0.12, 0.11) -0.17 0.869
aa anxiety -0.58 0.06 (-0.70, -0.46) -9.61 < .001
aa avoidance -0.37 0.06 (-0.49, -0.25) -6.09 < .001
aa anxiety × aa avoidance -0.12 0.05 (-0.21, -0.02) -2.41 0.017

Plotting the Relations

plot(estimate_relation(model4))

Estimating Simple Slopes

estimate_slopes(
  model = model4, 
  trend = "aa_anxiety",
  at = "aa_avoidance = c(-3, -1.5, 0, 1.5, 3)",
)
Estimated Marginal Effects
aa_avoidance Coefficient SE 95% CI t(296) p
-3.00 -0.23 0.16 (-0.55, 0.09) -1.39 0.165
-1.50 -0.40 0.10 (-0.60, -0.21) -4.03 < .001
0.00 -0.58 0.06 (-0.70, -0.46) -9.61 < .001
1.50 -0.75 0.09 (-0.93, -0.58) -8.55 < .001
3.00 -0.93 0.15 (-1.22, -0.63) -6.20 < .001

Marginal effects estimated for aa_anxiety

Plotting Simple Slopes

es4a <- estimate_slopes(model4, trend = "aa_anxiety", 
                        at = "aa_avoidance", length = 1000)
plot(es4a)

Estimating Simple Slopes

estimate_slopes(
  model = model4, 
  trend = "aa_avoidance",
  at = "aa_anxiety = c(-3, -1.5, 0, 1.5, 3)"
)
Estimated Marginal Effects
aa_anxiety Coefficient SE 95% CI t(296) p
-3.00 -0.02 0.15 (-0.32, 0.28) -0.11 0.912
-1.50 -0.19 0.09 (-0.37, -0.01) -2.12 0.035
0.00 -0.37 0.06 (-0.49, -0.25) -6.09 < .001
1.50 -0.54 0.10 (-0.73, -0.35) -5.52 < .001
3.00 -0.72 0.16 (-1.03, -0.40) -4.43 < .001

Marginal effects estimated for aa_avoidance

Plotting Simple Slopes

es4b <- estimate_slopes(model4, trend = "aa_avoidance", 
                        at = "aa_anxiety", length = 1000)
plot(es4b)

Discussion

Challenges and Opportunities

  • Products are only one type of interaction (bilinear)

    • Others include nonlinear, threshold, etc.
  • Measurement error gets compounded in moderation

    • Testing in the SEM framework may be necessary

    • Multivariate outliers can have a large influence

  • Power analysis is complicated for interactions

    • Interactions tend to be very power hungry

    • Simulation-based power analysis may be needed

  • Interpretations may differ between scales in GLM

    • Caution and justification are warranted

References

  • Bauer, D. J., & Curran, P. J. (2005). Probing interactions in fixed and multilevel regression: Inferential and graphical techniques. Multivariate Behavioral Research, 40(3), 373–400. https://doi.org/10/d5wzg5

  • Esarey, J., & Sumner, J. L. (2018). Marginal effects in interaction models: Determining and controlling the false positive rate. Comparative Political Studies, 51(9), 1144–1176. https://doi.org/10/gdw8xw

  • Finsaas, M. C., & Goldstein, B. L. (2021). Do simple slopes follow-up tests lead us astray? Advancements in the visualization and reporting of interactions. Psychological Methods, 26(1), 38–60. https://doi.org/10/ggsng9

  • McCabe, C. J., Kim, D. S., & King, K. M. (2018). Improving present practices in the visual display of interactions. Advances in Methods and Practices in Psychological Science, 1(2), 147–165. https://doi.org/10/gf5sqb

  • McClelland, G. H., & Judd, C. M. (1993). Statistical difficulties of detecting interactions and moderator effects. Psychological Bulletin, 114(2), 376–390. https://doi.org/10/cj3kvv

  • Miller, J. W., Stromeyer, W. R., & Schwieterman, M. A. (2013). Extensions of the Johnson-Neyman technique to linear models with curvilinear effects: Derivations and analytical tools. Multivariate Behavioral Research, 48(2), 267–300. https://doi.org/10/ggwpvb

  • Rohrer, J. M., & Arslan, R. C. (2021). Precise answers to vague questions: Issues with interactions. Advances in Methods and Practices in Psychological Science, 4(2), 1–19. https://doi.org/10/gk9zkd